Optimal. Leaf size=213 \[ \frac {i e^{-\left ((i-\log (f)) \left (a-\frac {b^2 (i-\log (f))}{4 i e-4 c \log (f)}\right )\right )} \sqrt {\pi } \text {Erf}\left (\frac {b (i-\log (f))+2 x (i e-c \log (f))}{2 \sqrt {i e-c \log (f)}}\right )}{4 \sqrt {i e-c \log (f)}}-\frac {i e^{(i+\log (f)) \left (a-\frac {b^2 (i+\log (f))}{4 i e+4 c \log (f)}\right )} \sqrt {\pi } \text {Erfi}\left (\frac {b (i+\log (f))+2 x (i e+c \log (f))}{2 \sqrt {i e+c \log (f)}}\right )}{4 \sqrt {i e+c \log (f)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.56, antiderivative size = 213, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 5, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {4560, 2325,
2266, 2236, 2235} \begin {gather*} \frac {i \sqrt {\pi } \exp \left (-\left ((-\log (f)+i) \left (a-\frac {b^2 (-\log (f)+i)}{-4 c \log (f)+4 i e}\right )\right )\right ) \text {Erf}\left (\frac {b (-\log (f)+i)+2 x (-c \log (f)+i e)}{2 \sqrt {-c \log (f)+i e}}\right )}{4 \sqrt {-c \log (f)+i e}}-\frac {i \sqrt {\pi } \exp \left ((\log (f)+i) \left (a-\frac {b^2 (\log (f)+i)}{4 c \log (f)+4 i e}\right )\right ) \text {Erfi}\left (\frac {b (\log (f)+i)+2 x (c \log (f)+i e)}{2 \sqrt {c \log (f)+i e}}\right )}{4 \sqrt {c \log (f)+i e}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2235
Rule 2236
Rule 2266
Rule 2325
Rule 4560
Rubi steps
\begin {align*} \int f^{a+b x+c x^2} \sin \left (a+b x+e x^2\right ) \, dx &=\int \left (\frac {1}{2} i e^{-i a-i b x-i e x^2} f^{a+b x+c x^2}-\frac {1}{2} i e^{i a+i b x+i e x^2} f^{a+b x+c x^2}\right ) \, dx\\ &=\frac {1}{2} i \int e^{-i a-i b x-i e x^2} f^{a+b x+c x^2} \, dx-\frac {1}{2} i \int e^{i a+i b x+i e x^2} f^{a+b x+c x^2} \, dx\\ &=\frac {1}{2} i \int \exp \left (-a (i-\log (f))-b x (i-\log (f))-x^2 (i e-c \log (f))\right ) \, dx-\frac {1}{2} i \int \exp \left (a (i+\log (f))+b x (i+\log (f))+x^2 (i e+c \log (f))\right ) \, dx\\ &=\frac {1}{2} \left (i \exp \left (-(i-\log (f)) \left (a-\frac {b^2 (i-\log (f))}{4 i e-4 c \log (f)}\right )\right )\right ) \int \exp \left (\frac {(-b (i-\log (f))+2 x (-i e+c \log (f)))^2}{4 (-i e+c \log (f))}\right ) \, dx-\frac {1}{2} \left (i \exp \left ((i+\log (f)) \left (a-\frac {b^2 (i+\log (f))}{4 i e+4 c \log (f)}\right )\right )\right ) \int \exp \left (\frac {(b (i+\log (f))+2 x (i e+c \log (f)))^2}{4 (i e+c \log (f))}\right ) \, dx\\ &=\frac {i \exp \left (-(i-\log (f)) \left (a-\frac {b^2 (i-\log (f))}{4 i e-4 c \log (f)}\right )\right ) \sqrt {\pi } \text {erf}\left (\frac {b (i-\log (f))+2 x (i e-c \log (f))}{2 \sqrt {i e-c \log (f)}}\right )}{4 \sqrt {i e-c \log (f)}}-\frac {i \exp \left ((i+\log (f)) \left (a-\frac {b^2 (i+\log (f))}{4 i e+4 c \log (f)}\right )\right ) \sqrt {\pi } \text {erfi}\left (\frac {b (i+\log (f))+2 x (i e+c \log (f))}{2 \sqrt {i e+c \log (f)}}\right )}{4 \sqrt {i e+c \log (f)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.95, size = 324, normalized size = 1.52 \begin {gather*} \frac {e^{-\frac {b^2 c \log ^3(f)}{2 \left (e^2+c^2 \log ^2(f)\right )}} f^{a-\frac {b^2}{2 (e-i c \log (f))}} \sqrt {\pi } \left (-e^{\frac {1}{4} b^2 \left (\frac {1}{-i e+c \log (f)}+\frac {\log ^2(f)}{i e+c \log (f)}\right )} f^{\frac {i b^2 c \log (f)}{e^2+c^2 \log ^2(f)}} \text {Erfi}\left (\frac {-i (b+2 e x)+(b+2 c x) \log (f)}{2 \sqrt {-i e+c \log (f)}}\right ) (e-i c \log (f)) \sqrt {-i e+c \log (f)} (\cos (a)-i \sin (a))+e^{\frac {1}{4} b^2 \left (\frac {\log ^2(f)}{-i e+c \log (f)}+\frac {1}{i e+c \log (f)}\right )} \text {Erfi}\left (\frac {-i (b+2 e x)-(b+2 c x) \log (f)}{2 \sqrt {i e+c \log (f)}}\right ) (e+i c \log (f)) \sqrt {i e+c \log (f)} (\cos (a)+i \sin (a))\right )}{4 \left (e^2+c^2 \log ^2(f)\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.91, size = 217, normalized size = 1.02
method | result | size |
risch | \(\frac {i \sqrt {\pi }\, f^{a} {\mathrm e}^{\frac {-\ln \left (f \right )^{2} b^{2}+4 i \ln \left (f \right ) a c -2 i \ln \left (f \right ) b^{2}-4 a e +b^{2}}{4 i e +4 c \ln \left (f \right )}} \erf \left (-\sqrt {-c \ln \left (f \right )-i e}\, x +\frac {b \ln \left (f \right )+i b}{2 \sqrt {-c \ln \left (f \right )-i e}}\right )}{4 \sqrt {-c \ln \left (f \right )-i e}}-\frac {i \sqrt {\pi }\, f^{a} {\mathrm e}^{-\frac {\ln \left (f \right )^{2} b^{2}+4 i \ln \left (f \right ) a c -2 i \ln \left (f \right ) b^{2}+4 a e -b^{2}}{4 \left (c \ln \left (f \right )-i e \right )}} \erf \left (-\sqrt {i e -c \ln \left (f \right )}\, x +\frac {b \ln \left (f \right )-i b}{2 \sqrt {i e -c \ln \left (f \right )}}\right )}{4 \sqrt {i e -c \ln \left (f \right )}}\) | \(217\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 1012 vs. \(2 (161) = 322\).
time = 0.30, size = 1012, normalized size = 4.75 \begin {gather*} \frac {\sqrt {\pi } \sqrt {2 \, c^{2} \log \left (f\right )^{2} + 2 \, e^{2}} {\left ({\left (f^{\frac {b^{2} c}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}} f^{a} \cos \left (-\frac {b^{2} e + {\left (2 \, b^{2} c - 4 \, a c^{2} - b^{2} e\right )} \log \left (f\right )^{2} - 4 \, a e^{2}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right ) - i \, f^{\frac {b^{2} c}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}} f^{a} \sin \left (-\frac {b^{2} e + {\left (2 \, b^{2} c - 4 \, a c^{2} - b^{2} e\right )} \log \left (f\right )^{2} - 4 \, a e^{2}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right )\right )} \operatorname {erf}\left (\frac {{\left (2 \, {\left (c \log \left (f\right ) - i \, e\right )} x + b \log \left (f\right ) - i \, b\right )} \sqrt {-c \log \left (f\right ) + i \, e}}{2 \, {\left (c \log \left (f\right ) - i \, e\right )}}\right ) + {\left (f^{\frac {b^{2} c}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}} f^{a} \cos \left (-\frac {b^{2} e + {\left (2 \, b^{2} c - 4 \, a c^{2} - b^{2} e\right )} \log \left (f\right )^{2} - 4 \, a e^{2}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right ) + i \, f^{\frac {b^{2} c}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}} f^{a} \sin \left (-\frac {b^{2} e + {\left (2 \, b^{2} c - 4 \, a c^{2} - b^{2} e\right )} \log \left (f\right )^{2} - 4 \, a e^{2}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right )\right )} \operatorname {erf}\left (\frac {{\left (2 \, {\left (c \log \left (f\right ) + i \, e\right )} x + b \log \left (f\right ) + i \, b\right )} \sqrt {-c \log \left (f\right ) - i \, e}}{2 \, {\left (c \log \left (f\right ) + i \, e\right )}}\right )\right )} \sqrt {c \log \left (f\right ) + \sqrt {c^{2} \log \left (f\right )^{2} + e^{2}}} + \sqrt {\pi } \sqrt {2 \, c^{2} \log \left (f\right )^{2} + 2 \, e^{2}} {\left ({\left (i \, f^{\frac {b^{2} c}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}} f^{a} \cos \left (-\frac {b^{2} e + {\left (2 \, b^{2} c - 4 \, a c^{2} - b^{2} e\right )} \log \left (f\right )^{2} - 4 \, a e^{2}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right ) + f^{\frac {b^{2} c}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}} f^{a} \sin \left (-\frac {b^{2} e + {\left (2 \, b^{2} c - 4 \, a c^{2} - b^{2} e\right )} \log \left (f\right )^{2} - 4 \, a e^{2}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right )\right )} \operatorname {erf}\left (\frac {{\left (2 \, {\left (c \log \left (f\right ) - i \, e\right )} x + b \log \left (f\right ) - i \, b\right )} \sqrt {-c \log \left (f\right ) + i \, e}}{2 \, {\left (c \log \left (f\right ) - i \, e\right )}}\right ) + {\left (-i \, f^{\frac {b^{2} c}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}} f^{a} \cos \left (-\frac {b^{2} e + {\left (2 \, b^{2} c - 4 \, a c^{2} - b^{2} e\right )} \log \left (f\right )^{2} - 4 \, a e^{2}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right ) + f^{\frac {b^{2} c}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}} f^{a} \sin \left (-\frac {b^{2} e + {\left (2 \, b^{2} c - 4 \, a c^{2} - b^{2} e\right )} \log \left (f\right )^{2} - 4 \, a e^{2}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right )\right )} \operatorname {erf}\left (\frac {{\left (2 \, {\left (c \log \left (f\right ) + i \, e\right )} x + b \log \left (f\right ) + i \, b\right )} \sqrt {-c \log \left (f\right ) - i \, e}}{2 \, {\left (c \log \left (f\right ) + i \, e\right )}}\right )\right )} \sqrt {-c \log \left (f\right ) + \sqrt {c^{2} \log \left (f\right )^{2} + e^{2}}}}{8 \, {\left (c^{2} e^{\left (\frac {b^{2} c \log \left (f\right )^{3}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}} + \frac {b^{2} e \log \left (f\right )}{2 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right )} \log \left (f\right )^{2} + e^{\left (\frac {b^{2} c \log \left (f\right )^{3}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}} + \frac {b^{2} e \log \left (f\right )}{2 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}} + 2\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 384 vs. \(2 (161) = 322\).
time = 3.31, size = 384, normalized size = 1.80 \begin {gather*} \frac {\sqrt {\pi } {\left (i \, c \log \left (f\right ) + e\right )} \sqrt {-c \log \left (f\right ) - i \, e} \operatorname {erf}\left (\frac {{\left ({\left (2 \, c^{2} x + b c\right )} \log \left (f\right )^{2} + 2 \, x e^{2} + b e + {\left (i \, b c - i \, b e\right )} \log \left (f\right )\right )} \sqrt {-c \log \left (f\right ) - i \, e}}{2 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right ) e^{\left (-\frac {{\left (b^{2} c - 4 \, a c^{2}\right )} \log \left (f\right )^{3} + i \, b^{2} e - {\left (-2 i \, b^{2} c + 4 i \, a c^{2} + i \, b^{2} e\right )} \log \left (f\right )^{2} - 4 i \, a e^{2} - {\left (b^{2} c - 2 \, b^{2} e + 4 \, a e^{2}\right )} \log \left (f\right )}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right )} + \sqrt {\pi } {\left (-i \, c \log \left (f\right ) + e\right )} \sqrt {-c \log \left (f\right ) + i \, e} \operatorname {erf}\left (\frac {{\left ({\left (2 \, c^{2} x + b c\right )} \log \left (f\right )^{2} + 2 \, x e^{2} + b e + {\left (-i \, b c + i \, b e\right )} \log \left (f\right )\right )} \sqrt {-c \log \left (f\right ) + i \, e}}{2 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right ) e^{\left (-\frac {{\left (b^{2} c - 4 \, a c^{2}\right )} \log \left (f\right )^{3} - i \, b^{2} e - {\left (2 i \, b^{2} c - 4 i \, a c^{2} - i \, b^{2} e\right )} \log \left (f\right )^{2} + 4 i \, a e^{2} - {\left (b^{2} c - 2 \, b^{2} e + 4 \, a e^{2}\right )} \log \left (f\right )}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}}\right )}}{4 \, {\left (c^{2} \log \left (f\right )^{2} + e^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int f^{a + b x + c x^{2}} \sin {\left (a + b x + e x^{2} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int f^{c\,x^2+b\,x+a}\,\sin \left (e\,x^2+b\,x+a\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________